﻿using Inovout.Models;
using NHibernate.Criterion;
using System.Collections.Generic;
using System.Linq;

namespace Inovout.Repositories
{
    public interface IRepository<TModel> where TModel : class
    {
        void Evict(TModel model);
        void Save(TModel model);
        IList<TModel> FindAll(params ICriterion[] criterions);
        int Count(params ICriterion[] criterions);
        bool Exists(params ICriterion[] criterions);
        void Delete(object id);
        void Delete(params ICriterion[] criterions);
        TModel FindById(object id);
        TModel Find(params ICriterion[] criterions);
        IDataObjectPagedSet<TModel> FindAll(int pageSize, int pageIndex, Order[] orders, params ICriterion[] criterions);
        bool IsUnique(object id, string propertyName, object propertyVallue);
        IQueryable<TModel> Query();
    }
}
